function loadCodeImag() {
		$("#codeImg").attr('src', '/code/geneCode.do?' + Math.random());
}

function login() {
	$.ajax({
		url : '/user/login.do',
		type : 'POST',
		data : {
			userName : $("#userName").val(),
			password : $("#password").val(),
			verificationCode : $("#verificationCode").val()
		},
		timeout : 5000,
		dataType : 'json',
		success : function(data) {
			if(data.success) {
				window.location.href = '/user/toHome.do';
	    	} else {
	    		$("#loginMsg").html(data.message);
	    	}
		},
		error : function(xhr, textStatus) {
			console.log('错误')
			console.log(xhr)
			console.log(textStatus)
		},
		complete : function() {
			console.log('结束')
		}
	});
}

$(function() {
	$('#doc-my-tabs').tabs();
})

function loadCodeImag() {
	$("#codeImg").attr('src','/code/geneCode.do?' + Math.random());
}

function regist() {
	$.ajax({
	    url:'/user/regist.do',
	    type:'POST',
	    data:{
	    	userName:$("#userName").val(), 
	    	password:$("#password").val(),
	    	passwordRepeat:$("#passwordRepeat").val(),
	    	phone:$("#phone").val(),
	    	mail:$("#email").val(),
	    	sex:$("#male").val(),
	    	sex:$("#female").val(),
	    	verificationCode:$("#verificationCode").val()
	    },
	    timeout:5000,
	    dataType:'json',
	    success:function(data){
	    	if(data.success) {
	    		window.location.href='/user/success.do';
	    	} else {
	    		$("#registMsg").html(data.message);
	    	}
	    },
	    error:function(xhr,textStatus){
	        console.log('错误')
	        console.log(xhr)
	        console.log(textStatus)
	    },
	    complete:function(){
	        console.log('结束')
	    }
	});
}